home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / libpgm.1 < prev    next >
Text File  |  1995-07-25  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4.      lllliiiibbbbppppggggmmmm((((3333))))                XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                 lllliiiibbbbppppggggmmmm((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           libpgm - functions to support portable graymap programs
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           #include <pgm.h>
  13.           cc ... libpgm.a libpbm.a
  14.  
  15.  
  16.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.         TTTTYYYYPPPPEEEESSSS AAAANNNNDDDD CCCCOOOONNNNSSSSTTTTAAAANNNNTTTTSSSS
  18.           typedef ... gray;
  19.           #define PGM_MAXMAXVAL ...
  20.           extern gray pgm_pbmmaxval;
  21.  
  22.           Each ggggrrrraaaayyyy should contain only the values between 0000 and
  23.           PPPPGGGGMMMM____MMMMAAAAXXXXMMMMAAAAXXXXVVVVAAAALLLL.  ppppggggmmmm____ppppbbbbmmmmmmmmaaaaxxxxvvvvaaaallll is the maxval used when a PGM
  24.           program reads a PBM file.  Normally it is 1; however, for
  25.           some programs, a larger value gives better results.
  26.  
  27.           #define PGM_FORMAT ...
  28.           #define RPGM_FORMAT ...
  29.           #define PGM_TYPE PGM_FORMAT
  30.           int PGM_FORMAT_TYPE( int format )
  31.  
  32.           For distinguishing different file formats and types.
  33.  
  34.         IIIINNNNIIIITTTTIIIIAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN
  35.           void pgm_init( int* argcP, char* argv[] )
  36.  
  37.           All PGM programs must call this routine.
  38.  
  39.         MMMMEEEEMMMMOOOORRRRYYYY MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT
  40.           gray** pgm_allocarray( int cols, int rows )
  41.  
  42.           Allocate an array of grays.
  43.  
  44.           gray* pgm_allocrow( int cols )
  45.  
  46.           Allocate a row of the given number of grays.
  47.  
  48.           void pgm_freearray( gray** grays, int rows )
  49.  
  50.           Free the array allocated with ppppggggmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) containing
  51.           the given number of rows.
  52.  
  53.           void pgm_freerow( gray* grayrow )
  54.  
  55.           Free a row of grays.
  56.  
  57.         RRRREEEEAAAADDDDIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  58.           void pgm_readpgminit( FILE* fp, int* colsP, int* rowsP, gray* maxvalP, int* formatP )
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                           (printed 9/7/93)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      lllliiiibbbbppppggggmmmm((((3333))))                XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                 lllliiiibbbbppppggggmmmm((((3333))))
  71.  
  72.  
  73.  
  74.           Read the header from a PGM file, filling in the rows, cols,
  75.           maxval and format variables.
  76.  
  77.           void pgm_readpgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int format )
  78.  
  79.           Read a row of grays into the grayrow array.  Format, cols,
  80.           and maxval were filled in by ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmiiiinnnniiiitttt(((()))).
  81.  
  82.           gray** pgm_readpgm( FILE* fp, int* colsP, int* rowsP, gray* maxvalP )
  83.  
  84.           Read an entire graymap file into memory, returning the
  85.           allocated array and filling in the rows, cols and maxval
  86.           variables.  This function combines ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmiiiinnnniiiitttt(((()))),
  87.           ppppggggmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) and ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmrrrroooowwww(((()))).
  88.  
  89.         WWWWRRRRIIIITTTTIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  90.           void pgm_writepgminit( FILE* fp, int cols, int rows, gray maxval, int forceplain )
  91.  
  92.           Write the header for a portable graymap file.  The
  93.           forceplain flag forces a plain-format file to be written, as
  94.           opposed to a raw-format one.
  95.  
  96.           void pgm_writepgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int forceplain )
  97.  
  98.           Write a row from a portable graymap.
  99.  
  100.           void pgm_writepgm( FILE* fp, gray** grays, int cols, int rows, gray maxval, int forceplain )
  101.  
  102.           Write the header and all data for a portable graymap.  This
  103.           function combines ppppggggmmmm____wwwwrrrriiiitttteeeeppppggggmmmmiiiinnnniiiitttt(((()))) and ppppggggmmmm____wwwwrrrriiiitttteeeeppppggggmmmmrrrroooowwww(((()))).
  104.  
  105.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  106.           libpbm(3), libppm(3), libpnm(3)
  107.  
  108.      AAAAUUUUTTTTHHHHOOOORRRR
  109.           Copyright (C) 1989, 1991 by Tony Hansen and Jef Poskanzer.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                           (printed 9/7/93)
  130.  
  131.  
  132.  
  133.